<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>友群消息</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>
<script type="text/javascript"> 
$(document).ready(function(){
    $(".panel").slideToggle("slow");
/* $(".flip").click(function(){
  }); */
});
</script>
 
<style type="text/css"> 
div.panel,p.flip
{
margin:0px;
padding:5px;
text-align:center;
background:#e5eecc;
border:solid 1px #c3c3c3;
font-size: 13px
}
div.panel
{
height:70px;
display:none;
}
</style>
</head>
<body>
<div class="container">
		<c:forEach items="${crowdApplyList}" var="crowdApply"  varStatus="status">
			<div id="apply${status.count}">
			<p class="flip"> <label style="color:#1111EE"> ${crowdApply.gameNickName}(${crowdApply.gameId}) </label> 申请加入  <label style="color:#1111EE"> ${crowdApply.crowdName}(${crowdApply.crowdId})</label>  </p>
			<div class="panel" align="left">
			<p align="left">&nbsp;&nbsp; 附加信息：<label style="color:#1111EE">${crowdApply.gameRemark}</label></p>
			<!-- <p align="left">&nbsp;&nbsp; 备     &nbsp;&nbsp;    注：<input width="80%" type="text" ></p> -->
			</div>
			<div align="right">
			<input type="button" name="" onclick="chenkStatus('${crowdApply.id}','1','apply${status.count}')" value="同意">
			<input type="button" name="" onclick="chenkStatus('${crowdApply.id}','2','apply${status.count}')" value="拒绝">
			</div>	
			</div>
		</c:forEach>
		
		<hr color="#FFFFF">
		
		<c:forEach items="${myCrowdApplyList}" var="crowdApply">
			<div id="join${status.count}">
			<p class="flip"> 您申请加入<label style="color:#1111EE">  ${crowdApply.crowdName}(${crowdApply.crowdId})    ${crowdApply.crowdStatus==0?'已发送，等待回复...':crowdApply.crowdStatus==1?'已通过':'已拒绝' }</label> </p>
			<%-- <div class="panel">
			<p align="left">&nbsp;&nbsp; 回复信息：<label style="color:#1111EE">${crowdApply.crowdRemark}</label></p>
			</div> --%>
			<div align="right">
			<input type="button" name="" onclick="chenkStatus('${crowdApply.id}','3','join${status.count}')" value="删除">
			</div>	
			</div>
		</c:forEach>
</div>
</body>
<script type="text/javascript">

function chenkStatus(crowdApplyId,status,divid){
	var remark ="";
    $.post("${pageContext.request.contextPath}/wechat/crowd_apply_edit.html",
	            {"crowdApplyId":crowdApplyId,"status":status,"remark":remark},
       function(data){
            	var json = eval("("+data+")");
            	$('#usersave').removeAttr("disabled");  //移除disabled属性 
				if(json.statusCode =='200'){
					if(status==1){
						layer.msg("已同意~" , {icon: 1});
					}else if(status==2){
						layer.msg("已拒绝~" , {icon: 1});
					}else{
						layer.msg("已删除~" , {icon: 1});
					}
					$("#"+divid).empty();
				}else{
					layer.msg(json.message, {shift: 6});
				}
      }); 
}
</script>
</html>